package cheme.ProcessModel.Interpreter.Parsers;

import cheme.Interpreter.Parser.Parser;
import syntaxtree.Node;

public class OverallStreamParser extends AbstractParser
{
	public boolean syntaxIsValid(String text)
	{
		return parse(text) != null;
	}
	
	@Override
	public String prepareString(String text)
	{
		return super.prepareString("[" + text + "]");
	}
	
	protected Node internalParse()
	{
		try
		{
			return Parser.SingleStreamDeclaration();
		}
		catch(Exception e)
		{
			String errorString = ParserErrorTransform.transform(e.getMessage());
			//System.out.println(errorString);
			throw new Error(errorString);
		}
	}
}